#ifndef _DEFINES_H_INCLUDED_
#define _DEFINES_H_INCLUDED_

#include "def.h"

typedef int     kz_thread_id_t;     // intに収まることは重要(sendで送ったりするので)
typedef void    (*kz_func_t)(int argc, char *argv);
typedef void    (*kz_handler_t)(void);
typedef int     kz_msgbox_id_t;     // 〃

#define THREAD_ID_NULL (-1)
#define THREAD_ID_ERR (-2)
#define MSGBOX_NULL (-1)

#define TICK_PER_SEC  100
static inline uint32 SECS(uint32 s) { return s * TICK_PER_SEC; }

#define THREAD_NUM 16
#define THREAD_NAME_SIZE 15
#define PRIORITY_NUM 16
#define MSGBOX_NUM   16
#define MSGBOX_PRIORITY_NUM 8
#if PRIORITY_NUM > 32 || MSGBOX_PRIORITY_NUM > 32
#error (MSGBOX_)PRIORITY_NUM is big
#endif

#define SRC_IP {192, 168, 0, 10}
#define SUBNET_MASK {255, 255, 255, 0}
#define DEFAULT_GATEWAY {192, 168, 0, 1}
#define DNS_SERVER {8, 8, 8, 8} // Google

#define NET_MBOXSIZE  3

#endif
